/*
 * Copyright (c) 2020 Tencent Cloud. All rights reserved.

 * Licensed under the MIT License (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://opensource.org/licenses/MIT

 * Unless required by applicable law or agreed to in writing, software distributed under the License is
 * distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */


#ifndef __BOARD_OPS_H__
#define __BOARD_OPS_H__

#include "esp_err.h"
#include <stdbool.h>

/* ESP8266-Launcher board */
/*
#define     GPIO_WIFI_LED   (12)

#define     GPIO_RELAY_LED  (15)


#define     GPIO_SET        (1)
#define     GPIO_CLEAR      (0)

#define     WIFI_LED_ON          GPIO_CLEAR
#define     WIFI_LED_OFF         GPIO_SET

#define     RELAY_LED_ON          GPIO_SET
#define     RELAY_LED_OFF         GPIO_CLEAR
*/
#define RESO_VAL 4

typedef enum {
    WHITE_MODE = 0,
    COLOUR_MODE = 1,
} WORK_MODE_E;

typedef struct 
{
	bool SWITCH;
    uint16_t BRIGHT;
    uint8_t COLOUR;
	uint16_t COL_TEMPERATURE;
    WORK_MODE_E WORK_MODE;
    uint8_t RED;
    uint8_t GREEN;
	uint8_t BLUE;
}DP_DEF;
extern DP_DEF dp_data;

typedef struct {
    uint8_t RED_VAL;
    uint8_t GREEN_VAL;
	uint8_t BLUE_VAL;
	uint8_t WHITE_VAL;
	uint8_t WARM_VAL;
    uint8_t LAST_RED_VAL;
    uint8_t LAST_GREEN_VAL;
	uint8_t LAST_BLUE_VAL;
	uint8_t LAST_WHITE_VAL;
	uint8_t LAST_WARM_VAL;
    uint8_t FIN_RED_VAL;
	uint8_t FIN_GREEN_VAL;
	uint8_t FIN_BLUE_VAL;
	uint8_t FIN_WHITE_VAL;
	uint8_t FIN_WARM_VAL;
}LIGHT_DATA_DEF;
extern LIGHT_DATA_DEF light_data;

typedef enum {
    switch_mode = 1,
    color_mode = 2,
    brightness_mode = 3,
    temperature_mode=4,
    red_mode=5,
    green_mode=6,
    blue_mode=7,
} change;


typedef enum {
    eCOLOR_RED = 0,
    eCOLOR_GREEN = 1,
    eCOLOR_BLUE = 2,
    eCOLOR_WHITE=3,
    eCOLOR_YELLOW=4,
} eColor;

void board_init(void);

//esp_err_t set_wifi_led_state(uint32_t state);
//esp_err_t set_relay_led_state(uint32_t state);


#endif //__BOARD_OPS_H__

